switch: Remove deprecated style properties
authorTimm Bäder <mail@baedert.org>
Tue, 4 Oct 2016 17:23:10 +0000 (19:23 +0200)
committerBenjamin Otte <otte@redhat.com>
Sun, 16 Oct 2016 16:17:21 +0000 (18:17 +0200)
gtk/gtkswitch.c

index 4b5e270aa0ca4ea8c9e02fd003b1cf37e722bcb5..e136f675d0267b3069e8a152a5801699959c54ac 100644 (file)
@@ -72,9 +72,6 @@
 
 #include "fallback-c89.c"
 
-#define DEFAULT_SLIDER_WIDTH    (36)
-#define DEFAULT_SLIDER_HEIGHT   (22)
-
 struct _GtkSwitchPrivate
 {
   GdkWindow *event_window;
@@ -374,41 +371,6 @@ gtk_switch_activate (GtkSwitch *sw)
   gtk_switch_begin_toggle_animation (sw);
 }
 
-static void
-gtk_switch_get_slider_size (GtkCssGadget   *gadget,
-                            GtkOrientation  orientation,
-                            gint            for_size,
-                            gint           *minimum,
-                            gint           *natural,
-                            gint           *minimum_baseline,
-                            gint           *natural_baseline,
-                            gpointer        unused)
-{
-  GtkWidget *widget = gtk_css_gadget_get_owner (gadget);
-  gdouble min_size;
-
-  if (orientation == GTK_ORIENTATION_HORIZONTAL)
-    {
-      min_size = _gtk_css_number_value_get (gtk_css_style_get_value (gtk_css_gadget_get_style (gadget), GTK_CSS_PROPERTY_MIN_WIDTH), 100);
-
-      if (min_size > 0.0)
-        *minimum = 0;
-      else
-        gtk_widget_style_get (widget, "slider-width", minimum, NULL);
-    }
-  else
-    {
-      min_size = _gtk_css_number_value_get (gtk_css_style_get_value (gtk_css_gadget_get_style (gadget), GTK_CSS_PROPERTY_MIN_HEIGHT), 100);
-
-      if (min_size > 0.0)
-        *minimum = 0;
-      else
-        gtk_widget_style_get (widget, "slider-height", minimum, NULL);
-    }
-
-  *natural = *minimum;
-}
-
 static void
 gtk_switch_get_content_size (GtkCssGadget   *gadget,
                              GtkOrientation  orientation,
@@ -935,38 +897,6 @@ gtk_switch_class_init (GtkSwitchClass *klass)
   klass->activate = gtk_switch_activate;
   klass->state_set = state_set;
 
-  /**
-   * GtkSwitch:slider-width:
-   *
-   * The minimum width of the #GtkSwitch handle, in pixels.
-   *
-   * Deprecated: 3.20: Use the CSS min-width property instead.
-   */
-  gtk_widget_class_install_style_property (widget_class,
-                                           g_param_spec_int ("slider-width",
-                                                             P_("Slider Width"),
-                                                             P_("The minimum width of the handle"),
-                                                             DEFAULT_SLIDER_WIDTH, G_MAXINT,
-                                                             DEFAULT_SLIDER_WIDTH,
-                                                             GTK_PARAM_READABLE|G_PARAM_DEPRECATED));
-
-  /**
-   * GtkSwitch:slider-height:
-   *
-   * The minimum height of the #GtkSwitch handle, in pixels.
-   *
-   * Since: 3.18
-   *
-   * Deprecated: 3.20: Use the CSS min-height property instead.
-   */
-  gtk_widget_class_install_style_property (widget_class,
-                                           g_param_spec_int ("slider-height",
-                                                             P_("Slider Height"),
-                                                             P_("The minimum height of the handle"),
-                                                             DEFAULT_SLIDER_HEIGHT, G_MAXINT,
-                                                             DEFAULT_SLIDER_HEIGHT,
-                                                             GTK_PARAM_READABLE|G_PARAM_DEPRECATED));
-
   /**
    * GtkSwitch::activate:
    * @widget: the object which received the signal.
@@ -1054,7 +984,7 @@ gtk_switch_init (GtkSwitch *self)
                                                    GTK_WIDGET (self),
                                                    priv->gadget,
                                                    NULL,
-                                                   gtk_switch_get_slider_size,
+                                                   NULL,
                                                    NULL,
                                                    gtk_switch_render_slider,
                                                    NULL,